package sch.frog.creational.prototype.model;

public class ObjB implements Cloneable{

    private ObjA objA;

    private int b;

    public ObjA getObjA() {
        return objA;
    }

    public void setObjA(ObjA objA) {
        this.objA = objA;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    @Override
    public String toString() {
        return "ObjB{" +
                "objB=" + objA.toString() +
                ", b=" + b +
                '}';
    }

    @Override
    public ObjB clone(){
        try {
            return (ObjB) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }
}
